/*
 *  Copyright 2005 Blandware (http://www.blandware.com)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.blandware.atleap.model.core.statistics;


/**
 * <p>Represents user agent (browser, OS, robot, their versions and so on).</p>
 * <p><a href="UserAgent.java.html"><i>View source</i></a></p>
 *
 * @author Roman Puchkovskiy <a href="mailto:roman.puchkovskiy@blandware.com">
 *         &lt;roman.puchkovskiy@blandware.com&gt;</a>
 * @version $Revision: 1.1 $ $Date: 2006/05/26 08:13:31 $
 */
public class UserAgent {

    /**
     * Description of browser
     */
    protected BrowserDescription browserDescription;

    /**
     * Browser version
     */
    protected String browserVersion;

    /**
     * Description of OS
     */
    protected OSDescription osDescription;

    /**
     * OS version
     */
    protected String osVersion;

    /**
     * Description of robot
     */
    protected RobotDescription robotDescription;

    /**
     * Robot description
     */
    protected String robotVersion;

    /**
     * Number of times this user agent was used
     */
    protected Integer count;

    /**
     * Constructs an instance of UserAgent initializing browser description.
     *
     * @param browserDescription browser description
     */
    public UserAgent(BrowserDescription browserDescription) {
        this.browserDescription = browserDescription;
        this.osDescription = null;
        this.robotDescription = null;
    }

    /**
     * Constructs an instance of UserAgent initializing OS description.
     *
     * @param osDescription browser description
     */
    public UserAgent(OSDescription osDescription) {
        this.browserDescription = null;
        this.osDescription = osDescription;
        this.robotDescription = null;
    }

    /**
     * Constructs an instance of UserAgent initializing browser and OS
     * descriptions.
     *
     * @param browserDescription browser description
     * @param osDescription OS description
     */
    public UserAgent(BrowserDescription browserDescription,
                     OSDescription osDescription) {
        this.browserDescription = browserDescription;
        this.osDescription = osDescription;
        this.robotDescription = null;
    }

    /**
     * Constructs an instance of UserAgent initializing robot description.
     *
     * @param robotDescription robot description
     */
    public UserAgent(RobotDescription robotDescription) {
        this.browserDescription = null;
        this.osDescription = null;
        this.robotDescription = robotDescription;
    }

    /**
     * Constructs an instance of UserAgent initializing browser, OS and robot
     * descriptions.
     *
     * @param browserDescription browser description
     * @param osDescription OS description
     * @param robotDescription robot description
     */
    public UserAgent(BrowserDescription browserDescription,
                   OSDescription osDescription,
                   RobotDescription robotDescription) {
        this.browserDescription = browserDescription;
        this.osDescription = osDescription;
        this.robotDescription = robotDescription;
    }

    /**
     * Returns browser description.
     *
     * @return browser description
     */
    public BrowserDescription getBrowserDescription() {
        return browserDescription;
    }

    /**
     * Sets browser description.
     *
     * @param browserDescription description to set
     */
    public void setBrowserDescription(BrowserDescription browserDescription) {
        this.browserDescription = browserDescription;
    }

    /**
     * Returns browser version.
     *
     * @return browser version
     */
    public String getBrowserVersion() {
        return browserVersion;
    }

    /**
     * Sets browser version.
     *
     * @param browserVersion version to set
     */
    public void setBrowserVersion(String browserVersion) {
        this.browserVersion = browserVersion;
    }

    /**
     * Returns OS description.
     *
     * @return OS description
     */
    public OSDescription getOsDescription() {
        return osDescription;
    }

    /**
     * Sets OS description.
     *
     * @param osDescription description to set
     */
    public void setOsDescription(OSDescription osDescription) {
        this.osDescription = osDescription;
    }

    /**
     * Returns OS version.
     *
     * @return OS version
     */
    public String getOsVersion() {
        return osVersion;
    }

    /**
     * Sets OS version.
     *
     * @param osVersion version to set
     */
    public void setOsVersion(String osVersion) {
        this.osVersion = osVersion;
    }

    /**
     * Returns robot description.
     *
     * @return robot description
     */
    public RobotDescription getRobotDescription() {
        return robotDescription;
    }

    /**
     * Sets robot description.
     *
     * @param robotDescription description to set
     */
    public void setRobotDescription(RobotDescription robotDescription) {
        this.robotDescription = robotDescription;
    }

    /**
     * Returns robot version.
     *
     * @return robot version
     */
    public String getRobotVersion() {
        return robotVersion;
    }

    /**
     * Sets robot version.
     *
     * @param robotVersion version to set
     */
    public void setRobotVersion(String robotVersion) {
        this.robotVersion = robotVersion;
    }

    /**
     * Returns count.
     *
     * @return count
     * @see #count
     */
    public Integer getCount() {
        return count;
    }

    /**
     * Sets count.
     *
     * @param count count to set
     * @see #count
     */
    public void setCount(Integer count) {
        this.count = count;
    }
}
